/*
 * @file    removeSpace.cpp
 * @author  libo <libo@tencent.com>
 * @date    2013-03-22
 * @brief   
 * */

#include <iostream>
using namespace std;

void removeSpace(char* str) {
    char* str1 = str;
    char* str2 = str;
    do
        while(*str2 == ' ') {
            ++str2;
        }
    while(*str1++ =  *str2++);
}

int main() {
    char tmp[100];
    strcpy(tmp, "1 2 sdfsd sdf.j");
    removeSpace(tmp);
    cout << tmp[2];
}
